package top.vanchor.flexible.entity;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author Ding
 * @since 2024-10-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Category implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @JsonProperty("id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 专题外键id
     */
    private Integer specialId;

    @TableField(exist = false)
    private String specialStr;


    /**
     * 类别名称
     */
    private String title;

    /**
     * 描述
     */
    private String introduction;

    /**
     * 封面插图资源id
     */
    private Integer imgId;

    @TableField(exist = false)
    private String imgUrl;

    /**
     * 标签
     */
    private String label;

    /**
     * 创建时间
     */
    @JsonProperty("createTime")
    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone = "Asia/Shanghai")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonProperty("updateTime")
    @TableField("update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone = "Asia/Shanghai")
    private Date updateTime;

    /**
     * 额外字段1
     */
    private String ext1;

    /**
     * 额外字段2
     */
    private String ext2;
    @TableField(exist = false)
    private List<CategoryItem> itemList;
    @TableField(exist = false)
    private CategoryItem categoryItem;
}
